<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\file\FileInput;
use kartik\select2\Select2;
use yii\web\JsExpression;
use app\common\Functions;
/* @var $this yii\web\View */
/* @var $model \yii2mod\rbac\models\BizRuleModel */
/* @var $form ActiveForm */
?>

<style>
    .prod-info-group  .list-group-item-big {content:'';  display: table;  clear: both }
</style>
<section class="content document-nav-form prod-info-group">
    <div class="row">
        <div class="box box-primary col-sm-6">
            <div class="box-body box-profile">
                <button type="button" class="close btn-default" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                    </button>
                <h3 class="profile-username text-center"><?= Html::encode( $model_name->prod_name ) ?></h3>
                <p class="text-muted text-center"><?= Html::encode( $model->parentRegions->region_name . ' ' . $model->regions->region_name ) ?></p>

                <ul class="list-group list-group-unbordered">
                    <?php if($p1): ?>
                    <div class="row">





                    <?php foreach ($p1[6] as $imageFile): ?>

                            <div class="col-xs-6 col-md-3">
                                <a href="#" class="thumbnail">
                                    <img src="<?= Html::encode($imageFile)  ?>" alt="tal">
                                </a>

                            </div>
                    <?php endforeach; ?>
                    </div>
                    <?php endif; ?>







                    <?php foreach ($model->prodAttrInsts as $prodAttrInst): ?>

                    <?php
                        if($attrSpecNames[$prodAttrInst->attr_spec_id]['attr_spec_type_id']==2)
                        {
                            continue;
                        }

                    ?>



                        <?php if($prodAttrInst->attr_spec_id==5): ?>

                            <li class="list-group-item list-group-item-big">

                        <?php else: ?>
                            <li class="list-group-item">
                        <?php endif; ?>

                            <b><?= Html::encode( $attrSpecNames[$prodAttrInst->attr_spec_id]['name'] ) ?></b>
                            <a class="pull-right">
                            <?php if($attrSpecNames[$prodAttrInst->attr_spec_id]['attr_spec_type_id'] ==3): ?>
                                <?= Html::encode(   Functions::getDomainsName('attr_spec',$prodAttrInst->attr_spec_id, $prodAttrInst->content )  ) ?>
                            <?php else: ?>

                                <?php if($prodAttrInst->attr_spec_id==4): ?>
                                    <?= Html::encode( $prod_housenumber ) ?>
                               <?php elseif($prodAttrInst->attr_spec_id==14): ?>

                                    <?= Html::encode( $prod_floor ) ?>

                                <?php else: ?>
                                    <?= Html::encode( $prodAttrInst->content  ) ?>
                                <?php endif; ?>

                            <?php endif; ?>
                            </a>
                        </li>
                    <?php endforeach; ?>

                    <li class="list-group-item">
                        <b><?= Html::encode('房东 ：'. $prod_manger_name  ) ?></b> <a class="pull-right">


                            <?= Html::encode( $prod_tel  ) ?>

                        </a>
                    </li>

                    <?php foreach ($topShows as $topShow): ?>
                        <li class="list-group-item">
                            <b><?= Html::encode( $topShow['field_name'] ) ?></b> <a class="pull-right">


                                <?= Html::encode( $topShow['field_values'] ) ?>

                            </a>
                        </li>
                    <?php endforeach; ?>
                </ul>
            </div>
            <div class="modal-footer">
                <?php echo Html::a(Yii::t('region', 'Cancel'), Yii::$app->request->getReferrer(), ['class' => 'btn btn-default']); ?>





            </div>
        </div>


    </div>



 </section >